package qmm.entity;

public interface StudentDao {
	List<Student>findAll(int page,int size,String sname,int ageMin,int ageMax);
	int del(int id);
	int edit(Student s);
	public int edit(Student s){
		String sql="update student set sname='"+s.getSname()+"',age="+s.getAge()+"where sid="+s.getSid();
		System.out.println(sql);
		retuern JdbcUtil.update(sql);
		
	}

}
public void edit(HttpServletRequest request,HttpServletResponse resoinse)throws ServletException,IOException{
	response.setCharacterEncoding("utf-8");
	System.out.println("edit");
	int sid = Integer.parseInt(request.getParameter("sid"));
	String sname = request.getParameter("sname");
	int age = Integer.parseInt(request.getParameter("age"));
	String s = new Student(sid,sname,age);
	int n = dao.edit(s);
	if(n>0){
		respomse.getWrite("success");
	}
}
